<template>
  <view class="action-container">
    <u-popup :show="showAction" mode="bottom" @close="onClose">
      <view class="top">
        <text>选中操作</text>
        <image src="@/static/icons/guanbi.svg" mode=""></image>
      </view>
      <view class="content">
        <u-cell-group :border="false">
          <u-cell :border="false" title="新增任务手机" @click="onAdd" isLink></u-cell>
          <u-cell :border="false" title="绑定老任务手机" @click="onBind" isLink></u-cell>
        </u-cell-group>
      </view>
    </u-popup>
  </view>
</template>

<script>
export default {
  name: 'ModalPopup',
  data() {
    return {}
  },
  computed: {
    showAction() {
      return this.$store.state.showAction
    }
  },
  methods: {
    onClose() {
      this.$store.dispatch('changeShowAction', false)
    },
    onAdd() {
      this.$store.dispatch('changeShowAction', false)
      uni.navigateTo({
        url: '/pages/addtaskphone/addtaskphone'
      })
    },
    onBind() {
      this.$store.dispatch('changeShowAction', false)
      uni.navigateTo({
        url: '/pages/bindoldphone/bindoldphone'
      })
    }
  }
}
</script>

<style lang="scss">
.action-container {
  .top {
    display: flex;
    padding: 20px 24px;
    justify-content: space-between;
    text {
      font-size: 18px;
      font-weight: bold;
    }
    image {
      width: 10px;
      height: 10px;
    }
  }
  .content {
    .u-cell {
      margin-top: 14px;
      background-color: #f7f7f7;
    }
  }
}
</style>
